<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: mkcube</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: mkcube</td>
      <td class="subheader-left"><a href="matlab:open mkcube">View code for mkcube</a></td>
    </tr>
  </table>
<h1>mkcube</h1><p><span class="helptopic">Create cube</span></p><p>
<strong>p</strong> = <span style="color:red">mkcube</span>(<strong>s</strong>, <strong>options</strong>) is a set of points (3x8) that define the
vertices of a cube of side length <strong>s</strong> and centred at the origin.

</p>
<p>
[<strong>x</strong>,<strong>y</strong>,<strong>z</strong>] = <span style="color:red">mkcube</span>(<strong>s</strong>, <strong>options</strong>) as above but return the rows of <strong>p</strong> as three
vectors.

</p>
<p>
[<strong>x</strong>,<strong>y</strong>,<strong>z</strong>] = <span style="color:red">mkcube</span>(<strong>s</strong>, 'edge', <strong>options</strong>) is a mesh that defines the edges of
a cube.

</p>
<h2>Options</h2>
<table class="list">
  <tr><td style="white-space: nowrap;" class="col1"> 'facepoint'</td> <td>Add an extra point in the middle of each face, in this case
the returned value is 3x14 (8 vertices + 6 face centres).</td></tr>
  <tr><td style="white-space: nowrap;" class="col1">'centre', C</td> <td>The cube is centred at C (3x1) not the origin</td></tr>
  <tr><td style="white-space: nowrap;" class="col1">'T', T</td> <td>The cube is arbitrarily transformed by the homogeneous
transform T</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'edge'</td> <td>Return a set of cube edges in MATLAB mesh format rather
than points.</td></tr>
</table>
<h2>See also</h2>
<p>
<a href="matlab:doc cylinder">cylinder</a>, <a href="matlab:doc sphere">sphere</a></p>
<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2012 Peter Corke.</p>
</body></html>